package com.jmoney.luckeylink.controller;

import static io.restassured.RestAssured.given;

import io.restassured.RestAssured;
import io.restassured.config.SSLConfig;
import io.restassured.response.Response;

public class LekeW_MessageCenter_Controller {
    /**
	    * 指定接口地址，获取消息中心信息
	    * @param ApiUrl
	    * @return AuthorizeInfo
	    */
    public static Object[] GetMessageCenterInfo(String ApiUrl) throws Exception{

    	Response response = given()
	               .config((RestAssured.config().sslConfig(new SSLConfig().relaxedHTTPSValidation())))
	               .contentType("application/json")
	               .log().all()
	               .request()
	               .when()
	               .get(ApiUrl);

	       response.print();
           String Json = response.asString();
	       
	       int status_code = response.jsonPath().getInt("status_code");
	       String message = response.jsonPath().get("message");
	       
	       int community_id = response.jsonPath().getInt("data[0].community_id");

           Object[] MessageCenterInfo ={Json,status_code,message,community_id};

	       return MessageCenterInfo;
	}     
}
